using Acme.BookStore.Purchase.NotificationOrderD;
using Acme.BookStore.PurchaseDto.NotificationOrder;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp;

namespace Acme.BookStore.HttpApi.Host.Controllers
{
    [RemoteService]
    [Route("api/app/notification-order")]
    [ApiController]
    public class NotificationOrderController : ControllerBase
    {
        //
        private readonly NotificationOrderService _service;
        public NotificationOrderController(NotificationOrderService service)
        {
            _service = service;
        }

        [HttpGet("query-notification-orders")]
        public async Task<List<NotificationOrderDto>> QueryNotificationOrdersAsync(
            [FromQuery] string notificationOrderNo = null,
            [FromQuery] string customerCode = null,
            [FromQuery] string customerName = null,
            [FromQuery] string notificationStatus = null,
            [FromQuery] string productCode = null,
            [FromQuery] string productName = null,
            [FromQuery] string customerOrderNo = null,
            [FromQuery] DateTime? productionDate = null)
        {
            var input = new NotificationOrderQueryDto
            {
                NotificationOrderNo = notificationOrderNo,
                CustomerCode = customerCode,
                CustomerName = customerName,
                NotificationStatus = notificationStatus,
                ProductCode = productCode,
                ProductName = productName,
                CustomerOrderNo = customerOrderNo,
                ProductionDate = productionDate
            };
            return await _service.QueryNotificationOrdersAsync(input);
        }
    }
} 